package com.example.expandablelistview.resourcemgn;

import android.app.Activity;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.widget.TextView;

import com.example.expandablelistview.R;

public class DisplayMetricsTest extends Activity {
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.displaymetricstest);

		//DisplayMetrics dm = new DisplayMetrics();
		//getWindowManager().getDefaultDisplay().getMetrics(dm);
		DisplayMetrics dm = getResources().getDisplayMetrics();

		StringBuilder sb = new StringBuilder();
		sb.append("widthPicels = " + dm.widthPixels +"\n");
		sb.append("heightPicels = " + dm.heightPixels +"\n");
		sb.append("densityDpi = " + dm.densityDpi + "\n");
		sb.append("density = " + dm.density + "\n");
		sb.append("scaledDensity = " + dm.scaledDensity + "\n");
		sb.append("xdpi = " + dm.xdpi + "\n");
		sb.append("ydpi = " + dm.ydpi + "\n");
		
		TextView info = (TextView)findViewById(R.id.result);
		info.setText(sb);
	}
}